﻿<Window x:Class="TFSChangeLog.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        DataContextChanged="OnDataContextChanged"
        Title="TFS ChangeLog Generator" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Height="590" Width="1016"
        WindowStartupLocation="CenterScreen" >
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="167*" />
            <ColumnDefinition Width="827*" />
        </Grid.ColumnDefinitions>
        <Label Content="TFS Server" Height="28" HorizontalAlignment="Left" Margin="39,61,0,0" Name="lblTFSServer" VerticalAlignment="Top" Width="82" />
        <Label Content="{Binding Path=TFSServerName}" Height="28" Margin="127,61,0,0" Name="TFSServerName" VerticalAlignment="Top" FontFamily="Arial" FontSize="14" IsManipulationEnabled="True" HorizontalAlignment="Left" Width="764" Grid.ColumnSpan="2" />
        <Label Content="TFS Project" Height="28" Margin="39,97,0,0" Name="lblTFSProject" VerticalAlignment="Top" HorizontalAlignment="Left" Width="82" />
        <Label Content="{Binding Path=TFSProjectName}" Height="28" Margin="127,97,0,0" Name="TFSProjectName" VerticalAlignment="Top" FontFamily="Arial" FontSize="14" HorizontalAlignment="Left" Width="764" Grid.ColumnSpan="2" />
        <Button Height="34" HorizontalAlignment="Left" Margin="149,12,0,0" VerticalAlignment="Top" Width="170" 
                Content="Connect to TFS"
                Name="btnConnectToTFS"
                Command="{Binding Path=ShowProjectSelector}" Grid.Column="1" />
        <TreeView Height="256" HorizontalAlignment="Left" Margin="39,139,0,0" VerticalAlignment="Top" Width="447"
                  Name="trvTFSBranches"
                  ItemsSource="{Binding FirstGeneration}" Grid.ColumnSpan="2">
            <TreeView.ItemContainerStyle>
                <!-- This Style binds a TreeViewItem to a PersonViewModel. -->
                <Style TargetType="{x:Type TreeViewItem}">
                    <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
                    <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
                    <Setter Property="FontWeight" Value="Normal" />
                    <Style.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="FontWeight" Value="Bold" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </TreeView.ItemContainerStyle>
            <TreeView.ItemTemplate>
                <HierarchicalDataTemplate ItemsSource="{Binding Children}">
                    <TextBlock Text="{Binding Name}" />
                </HierarchicalDataTemplate>
            </TreeView.ItemTemplate>
        </TreeView>
        <Rectangle Height="256" HorizontalAlignment="Left" Margin="341,139,0,0" Name="rectangle1" Stroke="Black" VerticalAlignment="Top" Width="454" Grid.Column="1" />
        <Label Content="Start From:" Height="29" HorizontalAlignment="Left" Margin="358,145,0,0" Name="lblStartFrom" VerticalAlignment="Top" Width="200" Grid.Column="1" />
        <Label Content="End To:" Height="29" HorizontalAlignment="Left" Margin="597,145,0,0" Name="lblEndTo" VerticalAlignment="Top" Width="188" Grid.Column="1" />
        <ComboBox Height="34" HorizontalAlignment="Left" Margin="362,182,0,0" Name="cmbStartFromChangeSet" VerticalAlignment="Top" Width="196" IsReadOnly="True" 
                  ItemsSource="{Binding Path=FromChangeSets}" 
                  SelectedItem="{Binding Path=SelectedFromChangeSet, Mode=TwoWay}"
                  IsEnabled="{Binding Path=IsFromChangeSetsEnabled}"
                  DisplayMemberPath="FromChangeSet.ChangesetId" 
                  SelectedValuePath="FromChangeSet.ChangesetId" Grid.Column="1">
            <ComboBox.ItemContainerStyle>
                <Style TargetType="{x:Type ComboBoxItem}">
                    <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
                    <Style.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="FontWeight" Value="Bold" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </ComboBox.ItemContainerStyle>
        </ComboBox>
        <ComboBox Height="34" HorizontalAlignment="Left" Margin="597,182,0,0" Name="cmbEndToChangeSet" VerticalAlignment="Top" Width="188" IsReadOnly="True" 
                  ItemsSource="{Binding Path=ToChangeSets}" 
                  SelectedItem="{Binding Path=SelectedToChangeSet, Mode=TwoWay}"
                  IsEnabled="{Binding Path=IsToChangeSetsEnabled}"
                  DisplayMemberPath="ToChangeSet.ChangesetId" 
                  SelectedValuePath="ToChangeSet.ChangesetId" Grid.Column="1">
            <ComboBox.ItemContainerStyle>
                <Style TargetType="{x:Type ComboBoxItem}">
                    <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
                    <Style.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="FontWeight" Value="Bold" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </ComboBox.ItemContainerStyle>
        </ComboBox>
        <Button Height="35" HorizontalAlignment="Left" Margin="141,404,0,0"  VerticalAlignment="Top" Width="178" 
                Content="Get ChangeSets" 
                Name="btnGetChangeSets"
                Command="{Binding Path=ShowSelectedProjectBranchNode}" Grid.Column="1" />
        <Button Height="36" HorizontalAlignment="Left" Margin="607,450,0,0" Name="button1" VerticalAlignment="Top" Width="188"
                Content="Generate Release Notes"
                Command="{Binding Path=GenerateReleaseNotes}" Grid.Column="1" />
        <TextBlock Text="Enter extensions for File changes(config,skin,png)" Name="tblXml" HorizontalAlignment="Left" Margin="339,404,0,0" VerticalAlignment="Top"
               Height="36" Width="290" Grid.Column="1" />
        <TextBox Name="txtFile" HorizontalAlignment="Left" Margin="610,404,0,0" VerticalAlignment="Top"
               Height="36" Width="190" Grid.Column="1" Text="{Binding Path=FileExtension,Mode=TwoWay}" IsEnabled="{Binding Path=IsTxtFileEnabled}" />
        <Button Height="36" HorizontalAlignment="Left" Margin="339,450,0,0" Name="btnXmlChanges" VerticalAlignment="Top" Width="150" 
                Content="Generate File Changes" Command="{Binding Path=GenerateXmlChanges}" Grid.Column="1" />
        <TextBlock Text="Supported file extensions - resx, config, skin, xml, css, png, jpeg, jpg, bmp, gif, thm, tif, yuv, psd." HorizontalAlignment="Right" Margin="130,510,0,0" VerticalAlignment="Top"
               Height="36" Width="520" Grid.Column="1" />
    </Grid>
</Window>
